//
//  KZLogVC.m
//  zhuyuanbao
//
//  Created by Jason T on 15/10/20.
//  Copyright © 2015年 KangZhi. All rights reserved.
//

#import "KZLogVC.h"
#import "TPKeyboardAvoidingTableView.h"
#import "View+MASAdditions.h"
#import "KZCoreBtn.h"
#import "KZMineVC.h"
#import "AppDelegate.h"
#import "UIImage+BlurredFrame.h"
//#import "UIView+Common.h"
#import "UIImage+Resizing.h"


@interface KZLogVC ()

//@property (nonatomic,strong)TPKeyboardAvoidingTableView * myTableView;
@property (weak, nonatomic) IBOutlet KZCoreBtn *avatarBtn;

@property (nonatomic,strong)UIImageView * bgBlurredView;
@end

@implementation KZLogVC

- (void)viewDidLoad {
    [super viewDidLoad];

    self.title = @"登录";

    self.avatarBtn.layer.cornerRadius = self.avatarBtn.width*0.15f;

    [self.view insertSubview:self.bgBlurredView atIndex:0];
   
}

- (UIImageView *)bgBlurredView{
    if (!_bgBlurredView) {
        //背景图片
        UIImageView *bgView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        bgView.contentMode = UIViewContentModeScaleAspectFill;
//        UIImage *bgImage = [[StartImagesManager shareManager] curImage].image;
        
        UIImage *bgImage = [UIImage imageNamed:@"test"];
        CGSize bgImageSize = bgImage.size, bgViewSize = CGSizeMake(bgImage.size.width*2, bgImage.size.height*2);
        if (bgImageSize.width > bgViewSize.width && bgImageSize.height > bgViewSize.height) {
            bgImage = [bgImage scaleToSize:CGSizeMake(bgImage.size.width*2, bgImage.size.height*2) usingMode:NYXResizeModeAspectFill];
        }
        bgImage = [bgImage applyLightEffectAtFrame:CGRectMake(0, 0, bgImage.size.width, bgImage.size.height)];
        bgView.image = bgImage;
        _bgBlurredView = bgView;
    }
    return _bgBlurredView;
}

- (IBAction)loginClick:(KZCoreBtn *)sender {
    
//    KZMineVC * mineVC = [[KZMineVC alloc]init];
//    [self.navigationController jumpToController:mineVC];
    [((AppDelegate *)[UIApplication sharedApplication].delegate) setupMainVC];

}



@end
